/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-01-11
 * Time: 18:43
 */

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-01-11
 * Time: 18:36
 */
/*
输入5行，每行：
书本名称 金额；
输出 汇总结果。
 */


import java.util.Scanner;

class Receipt{
    String name;
    String price;
    Receipt(String r){

    }

    public  String getName(){
        return name;
    }

    public String getPrice() {
        return price;
    }
}

class SumUp{
    String[] bookname;
    int amount=0;
    double price;
    SumUp(String []s) {
        bookname=s;
    }
    void Add(Receipt r){
        /************************begin**********************/
     if(r.getName().contains(bookname[0])||r.getName().contains(bookname[1])||r.getName().contains(bookname[2])) {
         amount++;
         price += Double.parseDouble(r.getPrice());
     }
        /*************************end***********************/

    }

    public String toString(){
        return amount+" "+price;
    }


}

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String []bookName=new String[]{"计算机","程序","算法"};
        SumUp sum=new SumUp(bookName);
        String books=null;
        for(int i=0;i<=4;i++){
            books=sc.nextLine();
            sum.Add(new Receipt(books));
        }
        System.out.println(sum);

    }
}